package net.togogo.bean;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;
import java.util.Date;
import java.util.List;
import java.util.Map;


/*
*@Component：注册成组件
* @ConfigurationProperties将配置文件中的值与属性进行绑定  只有这个才能提供功能
* prefix文件关联
* @Validated 数据校验
* */
@Component
@ConfigurationProperties(prefix = "user")
@Validated
public class User {
    private String nam;
    private Integer age;
    private Boolean stu;
    private Date brith;
    @Email
    private String email;

    private Map<String,Object> maps;
    private List<Object> lists;

    private Cat cat;

    @Override
    public String toString() {
        return "User{" +
                "nam='" + nam + '\'' +
                ", age=" + age +
                ", stu=" + stu +
                ", brith=" + brith +
                ", email='" + email + '\'' +
                ", maps=" + maps +
                ", lists=" + lists +
                ", cat=" + cat +
                '}';
    }

    public String getNam() {
        return nam;
    }

    public void setNam(String nam) {
        this.nam = nam;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Boolean getStu() {
        return stu;
    }

    public void setStu(Boolean stu) {
        this.stu = stu;
    }

    public Date getBrith() {
        return brith;
    }

    public void setBrith(Date brith) {
        this.brith = brith;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Map<String, Object> getMaps() {
        return maps;
    }

    public void setMaps(Map<String, Object> maps) {
        this.maps = maps;
    }

    public List<Object> getLists() {
        return lists;
    }

    public void setLists(List<Object> lists) {
        this.lists = lists;
    }

    public Cat getCat() {
        return cat;
    }

    public void setCat(Cat cat) {
        this.cat = cat;
    }
}
